package biz.yfsoft.app.fastframework.interceptor;

import biz.yfsoft.app.fastframework.Constant;

import com.jfinal.aop.Interceptor;
import com.jfinal.core.ActionInvocation;

public class AdminSessionInterceptor implements Interceptor {

	
	
	public void intercept(ActionInvocation ai) {
		Object user = ai.getController().getSessionAttr(Constant.KEY_ADMIN_USER);
		if (user == null) {
			ai.getController().redirect("/admin/login");
		}else{
			ai.invoke();
		}
	}

}
